<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style>
	.main_menu a
	{
		color:#FFFFFF;
		text-decoration:none;
	}
	.main_menu a:hover
	{
		font-weight:normal;
	}
	.sub_menu
	{
		display:none;
	}
	.sub_menu a
	{
		color:#414040;
		font-weight:normal;
		text-decoration:none;
		font-size:12px;
	}
	.sub_menu a:hover
	{
		color:#f05922;
		font-weight:normal;
		font-size:12px;
	}
</style>
<body>
	<div class="header_phai">DANH MỤC FILE</div>
	<div class="box">
	<?php
	$sql="select * from categories";
	$result=mysql_query($sql);
	while($rows=mysql_fetch_array($result))
	{
	?>
	<!-- Main menu -->
	<div class="main_menu">
	<a style="width:100%; height:100%;" href="index.php?page=listproduct&id=<?php echo $rows['id'];?>"><div style="line-height:30px; padding-left:10px; background:#D71A20; font-weight:bold; width:200px; border-bottom:1px dotted #CCCCCC; color:#ffffff;"><?php echo $rows['cateName']; ?></div></a>
	</div>
	<!-- Hết main menu -->
	<!-- Sub menu -->
	<!--<div style="margin-left:10px;" class="sub_menu" id="sub_<?php echo $rows['id']; ?>">
		<?php
			$sql2="select * from groupcategories where cateID='".$rows['id']."' order by groupName ASC";
			$result2=mysql_query($sql2);
			while($rows2=mysql_fetch_array($result2))
			{
			//print_r($rows2['id']);
			?>
			<div style="padding:5px;">
			<table border="0" cellpadding="0" cellspacing="0" class="leftmenutext">
				<tr>
					<td width="8" height="25" align=right><img src="images/leftmenu_icon.gif" width="4" height="5" border="0" /></td>
					<td background="images/leftmenu_gachduoi.gif" width="177" height="25"><a href="index.php?page=listproductDetail&id1=<?php echo $rows2['id'];?>&id=<?php echo $rows['id'];?>" ><?php echo $rows2['groupName']; ?></a></td>
				</tr>
			</table>	
			
			
			</div>
			<?php
			}
		?>
	</div>-->
	<!-- Hết Sub menu -->
	<?php
	}
?>
</div>
<!-- Xổ sub menu -->
<script>
	var id='<?php echo $_GET['id']; ?>';
	var sub_menu='sub_'+id;
	if(document.getElementById(sub_menu))
		document.getElementById(sub_menu).style.display='block';
	else
	{
		<?php
		$cate=$_GET['id'];
		
		$sql="select * from groupcategories where cateID='".$cate."'";
		$result=mysql_query($sql);
		if(mysql_num_rows($result)>0)
		{
			$rows=mysql_fetch_array($result);
		?>
		var id='<?php echo $rows['cateID']; ?>';
		var sub_menu='sub_'+id;
		if(document.getElementById(sub_menu))
			document.getElementById(sub_menu).style.display='block';
		<?php
		}
		?>
		
	}
</script>
</body>
</html>